<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sem título</title>
<link rel="stylesheet" href="responsaveiscss.css" type="text/css" />
<link rel="stylesheet" href="csspadrao.css" type="text/css" />
<script type="text/javascript" src="../classes/js/Busca_Registro.js"></script>
<script type="text/javascript" src="../classes/js/Busca_Registros.js"></script>
<script type="text/javascript" src="../classes/js/Registro.js"></script>
<script type="text/javascript" src="../classes/js/Registros.js"></script>
<script type="text/javascript" src="../classes/js/Empresa.js"></script>
<script type="text/javascript" src="../classes/js/medico.js"></script>
<script type="text/javascript" src="../js/funcoes.js"></script>
<script type="text/javascript" src="../classes/js/Abas.js"></script>
<link href="estilosistema.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">  
      
         newmedico=new medico();
         
        function exibe_campos(){
                codigo_medico=document.forms[1].elements['CODIGO_MEDICO'].value;
                document.forms[1].reset();
                //newmedico.setValores(newregistro.getValores());
                                
                if (acao=='I'){
                    document.forms[1].elements["CODIGO_MEDICO"].value = codigo_medico;
                }
                if (acao=='A'){
                        
                        document.forms[1].elements["CODIGO_MEDICO"].value = new String(newmedico.get_Codigo_Medico());
                        document.forms[1].elements["NOME_PROFISSIONAL"].value = new String(newmedico.get_Nome_Profissional());
                        document.forms[1].elements["AREA_ATUACAO"].value = new String(newmedico.get_Area_Atuacao());
			document.forms[1].elements["CEP"].value = new String(newmedico.get_Cep());
                        document.forms[1].elements["ENDERECO"].value = new String(newmedico.get_Endereco());
                        document.forms[1].elements["NIT"].value = new String(newmedico.get_Nit());
                        document.forms[1].elements["CPF"].value = new String(newmedico.get_Cpf());
                        document.forms[1].elements["BAIRRO"].value = new String(newmedico.get_Bairro());    
                        document.forms[1].elements["OBSERVACAO"].value = new String(newmedico.get_Observacao());    
                        document.forms[1].elements["MUNICIPIO"].value = new String(newmedico.get_Municipio());
                        document.forms[1].elements["UF"].value = new String(newmedico.get_UF());
                        document.forms[3].elements["txt_log_data_cadastro"].value = new String(newmedico.get_Data_Cadastro());                
                        document.forms[3].elements["txt_log_ultima_atualizacao"].value = new String(newmedico.get_Ultima_Atualizacao());                        document.forms[3].elements["txt_log_ultimo_usuario"].value = new String(newmedico.get_Ultimo_Usuario());                
                        
                       
                }
            }
            function carrega_campo(){
                 codigo_cnae=document.forms[1].elements['CODIGO_CNAE'].value;
                 cnae=Array();
                 descricao=Array();
                 observacao=Array();
                 var xtemp='';
                 var x='';
                 nregistros=newregistros.getValores();
                 for(i=0;i < nregistros.length;i++){
                    x=nregistros[i].split("|");
                    cnae[i]=x[0].substr(0,10);
                    xtemp=x[1];
                    descricao[i]=xtemp;

                 }
                 for (c=0;c<document.forms[1].elements['CODIGO_CNAE'].options.length-1;c++){
                     document.forms[1].elements['CODIGO_CNAE'].remove(c);
                 }
                 
                 
                 for (y=0;y<cnae.length;y++){
                             
                             //opt=document.createElement('option');
                             opt=new Option('Selecione um item',0);
                             if (y==0){
                                opt.text="Selecione um ítem";
                                opt.value="";
                             }
                             else {
                                opt.text=cnae[y]+" "+descricao[y];
                                opt.value=cnae[y];
                             }
                             
                             document.forms[1].elements['CODIGO_CNAE'].add(opt);
                        }
                        document.forms[1].elements['CODIGO_CNAE'].value=newmedico.get_CNAE();

            }
           

            
            var acao='';
            function grava_registro(){
             if (confirm("confirma o registro")){
                document.forms[1].action="../PHP/Medico_Class.php?acao=I";
                document.forms[1].submit();
             }
            }
            function apaga_registro(){
                if (confirm("Confirma a exclusão do registro?")){
                    document.forms[1].action="../PHP/Medico_Class.php?acao="+"D";
                    document.forms[1].submit();
                }
            }
            function proximo_registro(campo,visao){
                codemp=campo.value==''?0:campo.value;
                buscar_registro(window,campo.name,codemp,">",visao,"Busca_Medico");                    
                exibe_campos();
            }
            function registro_anterior(campo,visao){
                codemp=campo.value==''?0:campo.value;
                buscar_registro(window,campo.name, codemp,"<",visao,"Busca_Medico");
                exibe_campos();
            }  

        </script>
  
</head>

<body>
<div id="titulo">

<h1>Cadastro de Profissionais Médicos</h1>
</div>
<div id="menu">
     <form id="form2" action="" method="POST">
        <button type="button" onclick="">
  <table>
    <tr>
      <td height="42" width="48"><img src="../images/novo.png" height="40" width="40" /></td>
    </tr>
    <tr>
      <td height="16">Novo</td>
    </tr>
  </table>
  </button>
   
  <button type="button" onclick="grava_registro();">
  <table>
    <tr>
      <td height="42" width="48"><img src="../images/barra_ferramentas/floppy.png" height="40" width="40" /></td>
    </tr>
    <tr>
      <td height="16">Gravar</td>
    </tr>
  </table>
  </button>
  <button  type="button" onclick="apaga_registro();">
  <table>
    <tr>
      <td height="42" width="48"><img src="../images/barra_ferramentas/error_button_2.png" height="40" width="40" /></td>
    </tr>
    <tr>
      <td height="16">Apagar</td>
    </tr>
  </table>
  </button>
    <button  type="button" onclick="descer();">
  <table>
    <tr>
      <td height="42" width="48"><img src="../images/update_quantity_cart[1].png" height="40" width="40" /></td>
    </tr>
    <tr>
      <td height="16">Desfazer</td>
    </tr>
  </table>
  </button>
   <button  type="button" onclick="subir();">
  <table>
    <tr>
      <td height="42" width="48"><img src="../images/cima.gif" height="40" width="40" /></td>
    </tr>
    <tr>
      <td height="16">Primeiro</td>
    </tr>
  </table>
  </button>
    <button  type="button" onclick="navega_registro('Anterior');">
  <table>
    <tr>
      <td height="42" width="48"><img src="../images/left.png" height="40" width="40" /></td>
    </tr>
    <tr>
      <td height="16">Anterior</td>
    </tr>
  </table>
  </button>
      <button  type="button" onclick="navega_registro('Proximo')">
  <table>
    <tr>
      <td height="42" width="48"><img src="../images/right.png" height="40" width="40" /></td>
    </tr>
    <tr>
      <td height="16">Pr&oacute;ximo</td>
    </tr>
  </table>
  </button>
    <button  type="button" onclick="descer();">
  <table>
    <tr>
      <td height="42" width="48"><img src="../images/baixo.gif" height="40" width="40" /></td>
    </tr>
    <tr>
      <td height="16">Ultimo</td>
    </tr>
  </table>
  </button>
    <button  type="button" onclick="descer();">
  <table>
    <tr>
      <td height="40" width="48"><img src="../images/printer_2.png" height="40" width="40" /></td>
    </tr>
    <tr>
      <td height="18">Imprimir</td>
    </tr>
  </table>
  </button>
      <button  type="button" onclick="document.forms['form1'].reset();document.getElementById('iFrame1').src='';document.forms['form1'].elements['codigo_associado'].focus();">
  <table>
    <tr>
      <td height="42" width="48"><img src="../images/folha.jpg" height="40" width="40" /></td>
    </tr>
    <tr>
      <td height="16">Limpar</td>
    </tr>
  </table >
  </button>  
</form>
</div>
<div id="conteudo">
<form id="frm_medico" method="POST">
<table width="100%" class="tabela2">
<tr>
<td width="11%">Codigo
<input name="CODIGO_MEDICO" type="text" size="15" onblur="buscar_registro(window,this.name,this.value,'=','medicos','medicos','Busca_Medico',true,newmedico)"/></td>
<td width="30%">Nome
<input name="NOME_PROFISSIONAL" type="text" size="50" />
</td>
<td width="22%">Area De Atuação
  <select name="select" style="width:150px" id="select">
    <option value="  " selected="selected"> </option>
    <option value="Acupuntura" selected="">Acupuntura</option>
    <option value="Alergia e Imunologia" selected="">Alergia e Imunologia</option>	
    <option value="Anestesiologia" selected="">Anestesiologia</option>		
    <option value="Anestesiologia" selected="">Anestesiologia</option>		
    <option value="Angiologia" selected="">Angiologia</option>		
    <option value="Cancerologia" selected="">Cancerologia</option>		
    <option value="Cardiologia" selected="">Cardiologia</option>		
    <option value="Cirurgia Cardio-vascular" selected="">Cirurgia Cardio-vascular</option>		
    <option value="Cirurgia da Mão" selected="">Cirurgia da Mão</option>								
    <option value="Cirurgia Pediátrica" selected="">Cirurgia Pediátrica</option>								
    <option value="Cirurgia Plástica" selected="">Cirurgia Plástica</option>								
    <option value="Cirurgia Geral" selected="">Cirurgia Geral</option>								
    <option value="Cirurgia Neurológica" selected="">Cirurgia Neurológica</option>								
    <option value="Cirurgia do Aparelho Digestório" selected="">Cirurgia do Aparelho Digestório</option>								
    <option value="Cirurgia Torácica" selected="">Cirurgia Torácica</option>														
    <option value="Cirurgia Vascular" selected="">Cirurgia Vascular</option>														
    <option value="Clínica Geral" selected="">Clínica Geral</option>														
    <option value="Clínica Médica" selected="">Clínica Médica</option>														
    <option value="Coloproctologia" selected="">Coloproctologia</option>														
    <option value="Endocrinologia e Metabologia" selected="">Endocrinologia e Metabologia</option>																		
    <option value="Gastroenterologia" selected="">Gastroenterologia</option>																		
    <option value="Genética Médica" selected="">Genética Médica</option>																		
    <option value="Geriatria" selected="">Geriatria</option>																		
    <option value="Ginecolocia e Obstetrícia" selected="">Ginecolocia e Obstetrícia</option>																						
    <option value="Hematologia e Hemoterapia" selected="">Hematologia e Hemoterapia</option>																						
    <option value="Homeopatia" selected="">Homeopatia</option>																						
    <option value="Infectologia" selected="">Infectologia</option>																						
    <option value="Mastologia" selected="">Mastologia</option>																										
    <option value="Nefrologia" selected="">Nefrologia</option>																										
    <option value="Neurologia" selected="">Neurologia</option>																										
    <option value="Oftalmologia" selected="">Oftalmologia</option>																										
    <option value="Ortopedia" selected="">Ortopedia</option>																															
	<option value="Otorrinolaringologia" selected="">Otorrinolaringologia</option>	
	<option value="Patologia" selected="">Patologia</option>																															
	<option value="Pneumologia" selected="">Pneumologia</option>																															
	<option value="Radiologia" selected="">Radiologia</option>																																																													
	<option value="Radioterapia" selected="">Radioterapia</option>																																																													
	<option value="Reumatologia" selected="">Reumatologia</option>																																																															
	<option value="Urologia" selected="">Urologia</option>																																																														
  </select></td>
<td width="12%">NIT
<input name="NIT" type="text" size="15" />
</td>
<td width="15%">CPF
<input name="CPF" type="text" />
</td>
<td width="10%">&nbsp;</td>
</table>

</tr>
<table class="tabela">
<tr>
<td width="18%">Municipio
  <input name="MUNICIPIO" type="text" />
</td>
    <td width="12%">Bairro
        <input name="BAIRRO" type="text" />
    </td>
<td width="28%">Endereço
<input name="ENDERECO" type="text" size="50" />
</td>
<td width="9%"><p>UF

    <select name="UF_ATUACAO" style="width:50px" id="UF_ATUACAO">
      <option value="  " selected="selected"> </option>
      <option value="AC">AC</option>
      <option value="AM">AM</option>
      <option value="AL">AL</option>
      <option value="AP">AP</option>
      <option value="BA">BA</option>
      <option value="CE">CE</option>
      <option value="DF">DF</option>
      <option value="EF">EF</option>
      <option value="GO">GO</option>
      <option value="MA">MA</option>
      <option value="MG">MG</option>
      <option value="MS">MS</option>
      <option value="MT">MT</option>
      <option value="PA">PA</option>
      <option value="PB">PB</option>
      <option value="PE">PE</option>
      <option value="PI">PI</option>
      <option value="PR">PR</option>
      <option value="RJ">RJ</option>
      <option value="RN">RN</option>
      <option value="RO">RO</option>
      <option value="RR">RR</option>
      <option value="RS">RS</option>
      <option value="SC">SC</option>
      <option value="SE">SE</option>
      <option value="SP">SP</option>
      <option value="TO">TO</option>
    </select>

<td width="33%">Observação
<textarea name="OBSERVACAO" type="text"></textarea>
</td>
</tr>
</table>
</form>
</div>
</body>
</html>
